<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <title>后台管理登录</title>
    <link href="__LOGIN__/1/css/login.css" type="text/css" rel="stylesheet">
    <!-- Sco style -->
    <link rel="stylesheet" href="__ALTE__/plugins/sco/sco.message.css">
</head>
<body>

<div class="login">
    <div class="message">Flash - 管理登录</div>
    <div id="darkbannerwrap"></div>

    <input name="action" value="login" type="hidden">
    <input id="name" name="name" placeholder="用户名" required="" type="text">
    <hr class="hr15">
    <input id="password" name="password" placeholder="密码" required="" type="password">
    <hr class="hr15">
    <input id="loginbtn" value="登录" style="width:100%;" type="button">
    <hr class="hr20">
</div>
</body>
<!-- jQuery 2.2.3 -->
<script src="__ALTE__/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Sco -->
<script src="__ALTE__/plugins/sco/sco.message.js"></script>
<script>
    $('#loginbtn').on('click', function () {
        $.ajax({
            type : "post",
            url : 'alogin',
            dataType:"json",
            data: {
                name : $('#name').val()
                ,password : $('#password').val()
            },
            success : function(msg) {
                if (msg.code == 0) {
                    $.scojs_message(msg.msg, $.scojs_message.TYPE_OK);
                    setTimeout(function(){window.location.href = 'http://{$_SERVER['HTTP_HOST']}__ROOT__/__ADMIN__';}, 1500);
                } else {
                    $.scojs_message(msg.msg, $.scojs_message.TYPE_ERROR);
                }
            }
        });
    });
</script>
</html>